/**
 * 
 */
package com.axt.dbaudit.bean.cfg;

import java.util.List;

import com.axt.dbaudit.base.MsgFuncExt;
import com.axt.dbaudit.model.cfg.SafeCfg;
import com.axt.soa.bean.BaseFuncBean;
import com.axt.soa.msg.types.MsgParam;

public class SafeCfgBean extends BaseFuncBean {
	/**
	 * querySecurityCfg
	 * 
	 * @return
	 */
	public List<SafeCfg> querySafeCfg(String serverPath) {
		prepare(serverPath);
		
		return fetch(MsgFuncExt.FUNC_QUERY_SEC_CFG,"com.axt.dbaudit.model.SafeCfg","SafeCfg",CONN_T_TCP);
	}

	/**
	 * updateSecurityCfg
	 * 
	 * @param aSafeCfg
	 * 
	 */
	public int updateSafeCfg(String serverPath, SafeCfg safeCfg) {
		prepare(serverPath);
		
		request.addParam(MsgParam.MSG_COL_AU_TRYTIMES,
				safeCfg.getAu_tryTimes());
		request.addParam(MsgParam.MSG_COL_AU_DEALWAY, safeCfg.getAu_dealway());
		request.addParam(MsgParam.MSG_COL_AU_LOCKLENGTH,
				safeCfg.getAu_locklength());
		request.addParam(MsgParam.MSG_COL_AU_TIMEOUTCFG,
				safeCfg.getAu_timeoutCfg());
		return execute(MsgFuncExt.FUNC_UPDATE_SEC_CFG, CONN_T_TCP);
	}

}
